import React from "react"
import "./style.less"
import { useNavigate } from "react-router-dom"

const PubHeader = (props) =>{
   const Navigate=useNavigate();
    function backHandle(){
        /**
         * 返回上一页两种方案
         * 
         * hisotry.pushState()
         */
        // props.history.go(-1)
        // window.history.back();
        Navigate(-1)
    }

    return(
        <div id="common-header">
            <span className="back-icon" onClick={ backHandle }>
                <i className="iconfont icon-fanhui"></i>
            </span>
            <h1>{ props.title }</h1>
        </div>
    )
}

export default PubHeader